const JSDOM = require('jsdom').JSDOM;
const fs = require('fs');

function html2$(html) {
    let document = new JSDOM(html).window.document;
    return document.querySelectorAll.bind(document);
}

fs.readFile('tmp/shouji_tmall.html', (err, buffer) => {
    if (err) {
        console.log('读取失败');
    } else {
        let html = html2$(buffer.toString())('textarea.f1')[0].value;
        fs.writeFile('tmp/hot_shouji_tmall.html', html, () => {});
    }
})
